/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 主容器 */
.dashboard-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background-color: #f0f2f5;
}

/* 顶部导航栏 */
.main-header {
    height: 60px;
    background: linear-gradient(135deg, #3f4d67, #364156);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    color: #e0e6ed;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo img {
    height: 36px;
}

.logo span {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

/* 用户信息 */
.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    position: relative;
    padding: 8px 16px;
    border-radius: 8px;
    color: #e0e6ed;
    transition: all 0.3s ease;
    background: rgba(255,255,255,0.1);
}

.user-info:hover {
    background: rgba(255,255,255,0.15);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    display: none;
    min-width: 180px;
    border: 1px solid rgba(0,0,0,0.08);
}

.user-info:hover .user-dropdown {
    display: block;
}

.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
}

.user-dropdown a:hover {
    background-color: #f5f6fa;
}

/* 主要内容区 */
.main-content {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* 左侧菜单 */
.side-menu {
    width: 240px;
    background: linear-gradient(180deg, #3f4d67, #364156);
    padding: 20px 0;
    box-shadow: 2px 0 8px rgba(0,0,0,0.05);
}

.menu-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: #e0e6ed;
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
    position: relative;
}

.menu-item a:hover {
    background: rgba(255,255,255,0.1);
    border-left-color: rgba(255,255,255,0.5);
}

.menu-item a.active {
    background: rgba(255,255,255,0.15);
    border-left-color: #fff;
}

.menu-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
    color: rgba(255,255,255,0.7);
}

.menu-item a:hover i,
.menu-item a.active i {
    color: #fff;
}

.menu-item span {
    font-size: 14px;
    font-weight: 500;
}

.menu-item + .menu-item {
    margin-top: 2px;
}

/* 右侧内容区 */
.content-wrapper {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

/* 数据概览卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.stat-card {
    background: linear-gradient(135deg, #fff, #f8f9fa);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border: 1px solid rgba(255,255,255,0.8);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.primary .stat-icon {
    background: linear-gradient(135deg, #1976d2, #2196f3);
    color: white;
}

.success .stat-icon {
    background: linear-gradient(135deg, #2e7d32, #4caf50);
    color: white;
}

.warning .stat-icon {
    background: linear-gradient(135deg, #f57c00, #ff9800);
    color: white;
}

.info .stat-icon {
    background: linear-gradient(135deg, #0097a7, #00bcd4);
    color: white;
}

.stat-info h3 {
    font-size: 14px;
    color: #666;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.stat-desc {
    font-size: 12px;
    color: #666;
}

.up {
    color: #2e7d32;
}

.down {
    color: #d32f2f;
}

/* 图表区域 */
.charts-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.chart-container {
    background: linear-gradient(135deg, #fff, #f8f9fa);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border: 1px solid rgba(255,255,255,0.8);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.chart-header h3 {
    font-size: 16px;
    color: #333;
}

.chart-actions {
    display: flex;
    gap: 8px;
}

.btn-chart {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
}

.btn-chart.active {
    background: linear-gradient(135deg, #1a237e, #283593);
    color: #fff;
    border: none;
    box-shadow: 0 2px 4px rgba(26,35,126,0.2);
}

.btn-chart:hover {
    background: #f0f2ff;
}

.btn-refresh {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
}

.chart {
    height: 300px;
}

/* 实时监控面板 */
.monitor-panel {
    background: linear-gradient(135deg, #fff, #f8f9fa);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border: 1px solid rgba(255,255,255,0.8);
}

.monitor-panel h3 {
    font-size: 16px;
    color: #333;
    margin-bottom: 20px;
}

.monitor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.monitor-item {
    background: rgba(255,255,255,0.7);
    border: 1px solid #e8eaf6;
    border-radius: 8px;
    padding: 16px;
    transition: transform 0.2s;
}

.monitor-item:hover {
    transform: translateY(-2px);
}

.monitor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.status.running {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    color: #2e7d32;
    font-weight: 500;
}

.monitor-body {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.monitor-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.monitor-stat span:first-child {
    font-size: 12px;
    color: #666;
}

.monitor-stat span:last-child {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .side-menu {
        width: 64px;
    }

    .menu-item span {
        display: none;
    }

    .menu-item a {
        justify-content: center;
        padding: 12px;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .charts-section {
        grid-template-columns: 1fr;
    }
}